import type {
  RequestDocument,
  Variables
} from 'graphql-request/dist/types'
import type {
  JWTVerifyResult
} from 'jose/jwt/verify'

declare module 'egg' {
  interface Application {
    gqlRequest<T extends unknown>(
      query: RequestDocument,
      variables?: Variables
    ): Promise<T>
    jwt: {
      sign(payload: object, expiresIn?: string): Promise<string>,
      verify(token: string): Promise<JWTVerifyResult>
    }
  }
}
